/*java jdk 1.7+
# -*- coding: utf-8 -
'''
Created on 2020年05月10日
@author: zxyong 13738196011
'''*/

package com.zxy.business;

import org.eclipse.paho.client.mqttv3.MqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.eclipse.paho.client.mqttv3.MqttPersistenceException;
import org.eclipse.paho.client.mqttv3.MqttTopic;

public class Mqtt_Server
{
	// 发布MQTT信息
	public void publish(MqttTopic topic, MqttMessage message) throws MqttPersistenceException, MqttException
	{
		MqttDeliveryToken token = topic.publish(message);
		token.waitForCompletion();
	}
}